package com.miyu.system.pojo.system;

import com.miyu.system.utils.jpacomment.annotation.ColumnComment;
import com.miyu.system.utils.jpacomment.annotation.TableComment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 规则表;
 * @author : miyu
 * @date : 2023-7-23
 */
@ApiModel(value = "规则表",description = "")
@Data
@Entity
@Table(name="sys_rule")
@TableComment("规则表")
public class SysRule implements Serializable,Cloneable{
    /** 主键 */
    @Id
    @TableGenerator(name="id_gen",  table="sys_id_generator", pkColumnName="table_name", pkColumnValue="sys_rule", valueColumnName="id_value", initialValue=1, allocationSize=1)
    @GeneratedValue(strategy=GenerationType.TABLE, generator="id_gen")

    @ApiModelProperty(value="主键",notes = "")
    @Column(name = "rule_id", nullable = false,length=10 )
    @ColumnComment("主键")
    private Integer ruleId ;
    /** 规则编码 */
    @ApiModelProperty(value="规则编码",notes = "")
    @Column(name = "rule_code", nullable = true,length=30 )
    @ColumnComment("规则编码")
    private String ruleCode ;
    /** 是否停用 */
    @ApiModelProperty(value="是否停用",notes = "")
    @Column(name = "is_stop", nullable = true,length=1 )
    @ColumnComment("是否停用")
    private String isStop = "0" ;
    /** 搜索 */
    @ApiModelProperty(value="搜索",notes = "")
    @Column(name = "root_search", nullable = true,length=255 )
    @ColumnComment("搜索")
    private String rootSearch ;
    /** 根域名 */
    @ApiModelProperty(value="根域名",notes = "")
    @Column(name = "root_source", nullable = true,length=200 )
    @ColumnComment("根域名")
    private String rootSource ;
    /** 规则类型;1:书籍;2.电影 3 图片 等不同类型处理不一样 */
    @ApiModelProperty(value="规则类型",notes = "1:书籍;2.电影 3 图片 等不同类型处理不一样")
    @Column(name = "rule_type", nullable = true,length=10 )
    @ColumnComment("规则类型")
    private String ruleType ;
    /** 请求类型;请求类型 一般pots /get/put 等 */
    @ApiModelProperty(value="请求类型",notes = "请求类型 一般pots /get/put 等")
    @Column(name = "root_method", nullable = true,length=20 )
    @ColumnComment("请求类型")
    private String rootMethod ;
    /** 规则名称 */
    @ApiModelProperty(value="规则名称",notes = "")
    @Column(name = "rule_name", nullable = true,length=50 )
    @ColumnComment("规则名称")
    private String ruleName ;
    /** 规则设置 */
    @ApiModelProperty(value="规则设置",notes = "")
    @Column(name = "rule_set", nullable = true,length =8000 )
    @ColumnComment("规则设置")
    private String ruleSet ;
    /** 操作日期 */
    @UpdateTimestamp
    @ApiModelProperty(name = "操作日期",notes = "")
    @ColumnComment("操作日期")
    @Column(name = "update_time",columnDefinition = "timestamp default current_timestamp",nullable = false)
    private Timestamp updateTime ;
}